package com.zhijian.warehouse.manage.controller;

import com.zhijian.response.annotation.Response;
import com.zhijian.util.page.Page;
import com.zhijian.warehouse.manage.entity.vo.request.StoreOptRecordSearchVo;
import com.zhijian.warehouse.manage.entity.vo.request.StoreSaveOrUpdateVo;
import com.zhijian.warehouse.manage.entity.vo.request.StoreSearchVo;
import com.zhijian.warehouse.manage.entity.vo.response.IndexOutlineVo;
import com.zhijian.warehouse.manage.entity.vo.response.StoreOptRecordVo;
import com.zhijian.warehouse.manage.entity.vo.response.StoreVo;
import com.zhijian.warehouse.manage.service.IndexService;
import com.zhijian.warehouse.manage.service.StoreOptRecordService;
import com.zhijian.warehouse.manage.service.StoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 库存管理 控制层
 * 
 * @author auto
 * @version 1.0
 * @date 2024-10-27 13:42:54
 */
@Slf4j
@Controller
@Api(tags = "首页")
public class IndexController {

	@Autowired
    private StoreOptRecordService storeOptRecordService;

    @Autowired
    private IndexService service;

    /**
     * 出入明细
     *
     * @param param
     * @return
     */
    @Response
    @PostMapping("/index/store/opt/record/page")
    @ApiOperation("出入明细")
    public Page<StoreOptRecordVo> selectByCondition(@RequestBody(required = false) StoreOptRecordSearchVo param) {
        if (param == null)
            param = StoreOptRecordSearchVo.builder().build();
        log.info("{} - {}| selectByCondition info", this.getClass().getSimpleName(), param);
        return storeOptRecordService.selectPage(param);
    }




    /**
     * 根据id查询
     * @return
     */
    @Response
    @GetMapping("/index/line")
    @ApiOperation("首页数据")
    public IndexOutlineVo selectLineVo() {
        return service.selectLineVo();
    }

}